
import java.util.regex.*;
 
public class Main {
    public static void main(String[] args) {
        String phones1 = 
              "Justin's phone number: 0939-100391\n" +
              "momor's phone number: 0939-666888\n";
        
        Pattern pattern = Pattern.compile(".*09\\d{2}-\\d{6}");
        
        Matcher matcher = pattern.matcher(phones1);
        while(matcher.find()) {
//        while(phones1.matches(".*09\\d{2}-\\d{6}") ) {

//            System.out.println(matcher);
            System.out.println(matcher.group());
        }
        
        String phones2 = 
             "caterpillar's phone number: 0952-600391\n" +
             "bush's phone number: 0939-550391";
        
        matcher = pattern.matcher(phones2);
        while(matcher.find()) {
            System.out.println(matcher.group());
        }
    }
}